﻿using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;

namespace GMusicBox
{
    public partial class frmWelcome : PerPixelAlphaBlendForm
    {
        public frmWelcome()
        {
            InitializeComponent();
        }

        public bool close = false;
        Bitmap r;

        private void Form1_Load(object sender, EventArgs e)
        {
            this.Show();
            r = res.welcome;

            for (double i = 0; i <= 1; i += 0.1)
            {
                this.SetBitmap(r, (byte)(255 * i));
                this.Refresh();
                System.Threading.Thread.Sleep(25);
            }
            timerClose.Enabled = true;
        }

        private void timerClose_Tick(object sender, EventArgs e)
        {
            this.Close();
            timerClose.Enabled = false;
        }

        private void frmWelcome_FormClosing(object sender, FormClosingEventArgs e)
        {
            for (double i = 1; i >= 0; i -= 0.1)
            {
                this.SetBitmap(r, (byte)(255 * i));
                System.Threading.Thread.Sleep(25);
            }
            close = true;
        }
    }
}
